<template>
<div>
<Modal v-model="modalEdit" fullscreen @on-cancel="handleModalEditCancel" 
@on-ok="handleModalEditOK" ok-text="提交">
	<template #header>
		<Icon custom="iconfont icon-Word"/>&nbsp;案件移送函&nbsp;
		{{baseform.party_name}}&nbsp;涉嫌&nbsp;{{baseform.cause_name}}
	</template>
	<div><Row justify="center"><Col span="16"><Form ref="baseform" :model="baseform" :label-width="150">
		<Card title="案件移送" icon="ios-bookmark">
			<template #extra>
				提交日期：<DatePicker v-model="baseform.date2" type="date" placeholder="选择日期" style="width: 200px"></DatePicker>
			</template>
			<FormItem label="受移送机关的名称" prop="transfer_name">
				<Input v-model="baseform.transfer_name" placeholder="输入名称" style="width: 320px;"/>
			</FormItem>
			<FormItem label="当事人的违法行为时间、地点、情节、内容等" prop="introduce">
				<Input v-model="baseform.introduce" maxlength="300" show-word-limit type="textarea" :rows="3"/>
			</FormItem>
			<FormItem label="案件移送理由" prop="reason">
				<Input v-model="baseform.reason" maxlength="300" show-word-limit type="textarea" :rows="3"/>
			</FormItem>
			<FormItem label="案件移送依据" prop="basis">
				<Input v-model="baseform.basis" maxlength="300" show-word-limit type="textarea" :rows="3"/>
			</FormItem>
		</Card>
	</Form></Col></Row></div>
</Modal>
</div>
</template>

<script>
import {dateUtils,appendDoc} from '@/libs/tools.js'
import config from '@/config'
export default{
	data(){
		return {
			modalEdit:true,
			baseform:{}		
		}
	},
	methods:{
		handleModalEditCancel(){
			this.$router.go(-1)
		},
		handleModalEditOK(){
			let data={...this.baseform}
			data.undertaker_name=this.$store.state.user.userInfo.uname
			data.date2=dateUtils.format2(data.date2)
			data.docs=appendDoc(data.docs,"doc004")
			this.$axios.post('mainCase1CreateDoc004.action',data).then(res=>{
				window.open(config.baseUrl+res.data,'_blank')
			})
			this.$router.go(-1)
		}
	},
	mounted(){
		this.$axios.post('mainCase1GetDoc004.action',{
			case_no:this.$route.query.case_no,
			party_type:this.$route.query.party_type
		}).then(res=>{
			this.baseform={...this.baseform,...res.data}
		})
	}
}
</script>

<style>
</style>